<div class="wrapper">
    <div>
        <div class="box box-top">
            <!-- /.box-header -->
            <!-- form start -->
            <form id="roleRangeForm" role="form" action="${base}/admin/roleRange/save" method="post">
                <input type="hidden" name="id" value="${(roleRange.id)!}">
                <div class="box-body">
                            <div class="form-group">
                                <label for="id"></label>
                                <input type="text" value="${(roleRange.id)!}" class="form-control" name="id" id="id">
                            </div>

                            <div class="form-group">
                                <label for="rangeInfoId">权限Id</label>
                                <input type="text" value="${(roleRange.rangeInfoId)!}" class="form-control" name="rangeInfoId" id="rangeInfoId">
                            </div>

                            <div class="form-group">
                                <label for="roleId">角色Id</label>
                                <input type="text" value="${(roleRange.roleId)!}" class="form-control" name="roleId" id="roleId">
                            </div>

                            <div class="form-group">
                                <label for="valid">Valid</label>
                                <select  name="valid" id="valid" class="form-control">
                                    <option value="true" <#if ((roleRange.valid)!true)==true> selected="selected" </#if>>----Valid----</option>
                                    <option value="false" <#if ((roleRange.valid)!true)==false> selected="selected" </#if>>----Invalid----</option>
                                </select>
                            </div>

                            <div class="form-group">
                                <label for="ordinal">SequenceNo</label>
                                <input type="text" value="${(roleRange.ordinal)!}" class="form-control" name="ordinal" id="ordinal">
                            </div>

                    <div class="box-footer">
                        <button type="button" onclick="$('#roleRangeForm').submit();" class="btn btn-primary">Save
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $("#roleRangeForm").validate({
            submitHandler:function(form){
                submitRoleRange();
            }
        });
    });
    function submitRoleRange(){
        HF.ajaxFormSubmit('roleRangeForm',function(result){
            alert("Save Success");
            document.location.reload();
        },function(e){ alert("Save Failure");});
    }
</script>
